<!DOCTYPE html>
<head>
	<?php echo $this->Html->charset(); ?>
	<title><?php echo $title_for_layout; ?></title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<?php
		echo $this->Html->meta('icon');

		echo $this->Html->css('jquery.ui-1.8.16/jquery.ui.1.8.16.bootstrap.css');
		echo $this->Html->css('bootstrap-2.0.2/bootstrap.css');
		echo $this->Html->css('bootstrap-2.0.2/bootstrap-responsive.css');
		echo $this->Html->css('app.default.css');

		if (Configure::read('debug') > 0) {
			echo $this->Html->css('cake.debug.css');
		}

		echo $this->fetch('meta');
		echo $this->fetch('css');
	?>

	<!--[if IE]>
		<?php echo $this->Html->css('jquery.ui.bootstrap/jquery.ui.1.8.16.ie.css'); ?>
	<![endif]-->

</head>
<body>

	<div class="navbar">
		<div class="navbar-inner">
			<div class="container">
				<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</a>
				<h1 class="site-title"><?php echo $this->Html->link(Configure::read('App.name'), array('controller' => 'pages', 'action' => 'display', 'home', 'admin' => false), array('target' => '_blank', 'title' => __('View Website'), 'class' => 'brand')); ?></h1>
				<div class="nav-collapse">
					<ul class="nav">
						<li><?php echo $this->Html->link('首页', array('controller' => 'pages', 'action' => 'display', 'home'), array('class' => 'current'));?></li>
						<li class="dropdown">
							<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">在线学习<b class="caret"></b></a>
							<ul class="dropdown-menu">
								<li><?php echo $this->Html->link('专题讲解' , array('controller' => 'articles', 'action' => 'index', 'category' => 39));?></li>
								<li><?php echo $this->Html->link('学习教程' , array('controller' => 'tutorials', 'action' => 'index'));?></li>
								<li><?php echo $this->Html->link('习题训练' , array('controller' => 'exercises', 'action' => 'index'));?></li>
								<li><?php echo $this->Html->link('名词术语' , array('controller' => 'terminologies', 'action' => 'index'));?></li>
							</ul>
						</li>
						<li class="dropdown">
							<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">资源下载<b class="caret"></b></a>
							<ul class="dropdown-menu">
								<li><?php echo $this->Html->link('课件下载' , array('controller' => 'downloads', 'action' => 'index', 'category' => 40));?></li>
								<li><?php echo $this->Html->link('试题下载' , array('controller' => 'downloads', 'action' => 'index', 'category' => 41));?></li>
								<li><?php echo $this->Html->link('软件下载' , array('controller' => 'downloads', 'action' => 'index', 'category' => 42));?></li>
							</ul>
						</li>
						<li class="dropdown">
							<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">科学研究<b class="caret"></b></a>
							<ul class="dropdown-menu">
								<li><?php echo $this->Html->link('导师风采' , array('controller' => 'articles', 'action' => 'index', 'category' => 2));?></li>
								<li><?php echo $this->Html->link('学生风采' , array('controller' => 'articles', 'action' => 'index', 'category' => 3));?></li>
								<li><?php echo $this->Html->link('研究成果' , array('controller' => 'articles', 'action' => 'index', 'category' => 4));?></li>
								<li><?php echo $this->Html->link('生化快讯' , array('controller' => 'articles', 'action' => 'index', 'category' => 46));?></li>
							</ul>
						</li>
					</ul>
					<ul class="nav pull-right">
						<li><?php echo $this->Html->link(__('Admin'), array('controller' => 'users', 'action' => 'login', 'admin' => true));?></li>
						<li class="divider-vertical"></li>
						<li class="dropdown">
							<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">其他<b class="caret"></b></a>
							<ul class="dropdown-menu">
								<li><?php echo $this->Html->link(__('About'), array('controller' => 'pages', 'action' => 'display', 'about'));?></li>
								<li><?php echo $this->Html->link(__('Contact'), array('controller' => 'pages', 'action' => 'display', 'contact'));?></li>
								<li><a href="mailto:wangshijun2010@gmail.com"><?php echo __('Support');?></a></li>
							</ul>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<div id="container" class="container">

		<!-- Main Start -->
		<?php $sidebar = $this->fetch('sidebar'); ?>

		<?php if (empty($sidebar)): ?>

			<div id="main" class="row">
				<div class="span12">
					<div id="content">
						<?php echo $this->Session->flash(); ?>
						<?php echo $this->Session->flash('auth', array('element' => 'auth')); ?>
						<?php echo $this->fetch('content'); ?>
					</div>
				</div>
			</div>

		<?php else: ?>

			<div id="main" class="row">
				<div class="span3">
					<?php echo $sidebar;?>
				</div>
				<div class="span9">
					<div id="content">
						<?php echo $this->Session->flash(); ?>
						<?php echo $this->Session->flash('auth', array('element' => 'auth')); ?>
						<?php echo $this->fetch('content'); ?>
					</div>
				</div>
			</div>

		<?php endif; ?>
		<!-- Main End -->

		<!-- Footer Start -->
		<div id="footer">
			<p class="pull-right">
				<?php echo $this->Html->link($this->Html->image('cake.power.gif', array('border' => '0')), 'http://www.cakephp.org/', array('target' => '_blank', 'escape' => false)); ?>
			</p>
			<p>北京科技大学版权所有 &copy; 2012</p>
		</div>
		<!-- Footer End -->

	</div>

	<?php //echo $this->element('sql_dump'); ?>


	<?php	// Scripts comes last to make page load faster

		echo $this->Html->script('jquery/jquery-1.7.2.min.js');
		echo $this->Html->script('bootstrap-2.0.2/bootstrap.js');
		echo $this->Html->script('app.core.js');
		echo $this->Html->script('app.default.js');
		echo $this->fetch('script');
	?>

	<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
</body>
</html>
